import axios from 'axios';
//查询区接口
function searchReq(param) {
    console.log("param===search==",param)
    return axios({
        method:"post",
        url:'/ygcenterprise/queryByCondition',
        data: param,
        headers:{
            'Cache-Control':'no-cache'
        }
    });

}
//查询区接口
function queryCardReq(param) {
    console.log("param===search=="+JSON.stringify(param))
    return axios({
        method:"get",
        url:'/ygcenterprise/queryDetail',
        params: {
            ieStamp :new Date().getTime(),isAjax:1,
            ...param
        },
        headers:{
            'Cache-Control':'no-cache'
        }
    });

}
//查询区接口
function orgCreateBusinessReq (param) {
    console.log("param====orgCreateBusiness===",param)
    return axios({
        method : 'get',
        url : `/ygcenterprise/addEtpByOrg`,
        params: {
            ieStamp :new Date().getTime(),isAjax:1,
            ...param
        },
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//保存企业信息接口
function saveReq(param) {
    return axios({
        method : 'post',
        url : '/ygcenterprise/save',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}
//删除企业信息接口
function deleteCenterPriseReq(param) {
    return axios({
        method : 'post',
        url : '/ygcenterprise/delete',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}
//初始化和刷新接口
function refershReq() {
    return axios({
        method : 'post',
        url : '/ygcenterprise/list',
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}
//授权与否接口
function empowerReq(params) {
    return axios({
        method : 'post',
        url : `/personnel/onOffPersonnel?onOff=${params.onOff}`,
         // url : ` /ygcenterprise/test?onOff=${params.onOff}`,
        data: params.personnelVOS,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//是否有新增的权限
function addReq(params) {
    return axios({
        method : 'post',
        url : `/ygcenterprise/add`,
        data: params,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}
export {
    searchReq,
    orgCreateBusinessReq,
    saveReq,
    deleteCenterPriseReq,
    refershReq,
    queryCardReq,
    empowerReq,
    addReq
}